package cn.cnf.service;


import cn.cnf.common.enums.WorkType;
import cn.cnf.entity.Subscribe;
import cn.cnf.entity.vo.SubscribeInfo;
import com.baomidou.mybatisplus.extension.service.IService;

import java.util.List;

/**
 * 服务接口
 *
 * @author ZhuMeiYi
 * @description
 * @since 2020-12-25 12:19:41
 */
public interface SubscribeService extends IService<Subscribe> {

    /**
     * 确认订阅
     *
     * @param subscribe
     * @return
     */
    String confirmSubscribe(Subscribe subscribe);

    /**
     * 取消订阅
     *
     * @param subscribe
     * @return
     */
    String cancelSubscribe(Subscribe subscribe);

    /**
     * 获得全部订阅的漫画
     *
     * @return
     */
    List<SubscribeInfo> getAllComic();

    /**
     * 获得全部订阅的小说
     *
     * @return
     */
    List<SubscribeInfo> getAllNovel();

    /**
     * 是否订阅了某作品
     *
     * @param username
     * @param subscribeId
     * @return
     */
    boolean ifSubscribe(String username, String subscribeId, String chapterId);

    /**
     * 根据用户名判断某漫画某章节是否有阅读权限
     *
     * @param username
     * @param workId
     * @param chapterId
     * @return
     */
    boolean authority(String username, String workId, String chapterId, WorkType workType);
}
